// JavaScript Document
function hideElement()
	{
		for (var i = arguments.length - 1; i >= 0; --i)
		
		{
		if (document.getElementById(arguments[i]).className != "hideElement")
		{
		document.getElementById(arguments[i]).className = "hideElement";
		}
		}
	}
	
	function showElement()
	{
		for (var i = arguments.length - 1; i >= 0; --i)
		{
		if (document.getElementById(arguments[i]).className != "showElement")
		{
		document.getElementById(arguments[i]).className = "showElement";
		}
		}
	}

function selectAgent(thisObj){
	if(thisObj.value == "agent") {
		document.getElementById("showAgent").className = "showElemnet";	
		
	} 
	if(thisObj.value == "direct"|| thisObj.value=="default") {
		document.getElementById("showAgent").className = "hideElement";	
	}
	if(thisObj.value == "LocationOther") {
		document.getElementById("showLocationOther").className = "showElement";	
	}
	if(thisObj.value != "LocationOther") {
		document.getElementById("showLocationOther").className = "";	
	}
}

function showOtherProperty(thisObj){
	if (thisObj.checked==true){
		document.getElementById("showPropertyOther").className = "showElemnet";	
		document.getElementById("txt_property_other").focus()
		}
		if(thisObj.checked==false){
			document.getElementById("showPropertyOther").className = "hideElement";	}
}
function showAmenitiesInhouseOther(thisObj){
	if (thisObj.checked==true){
		document.getElementById("showInhouseOther").className = "showElemnet";	
		document.getElementById("txt_inhouse_other").focus()
		}
		if(thisObj.checked==false){
			document.getElementById("showInhouseOther").className = "hideElement";	}
	}
	function showAmenitiesExternalOther(thisObj){
	if (thisObj.checked==true){
		document.getElementById("showExternalOther").className = "showElemnet";	
		document.getElementById("txt_external_other").focus()
		}
		if(thisObj.checked==false){
			document.getElementById("showExternalOther").className = "hideElement";	}
	}
	/* code for character count*/
	function textAreaCharCounter(element,length,counterField,counterType){
			if(element != null){
				if(counterType == 'increment'){
					counterField.value = element.value.length;
				}else{
					if(element.value.length > length)
						element.value = element.value.substring(0,length);
					else
						counterField.value = length - element.value.length;
				}
				
			}
		}	